package com.wmeimob.fastboot.jiubei.entity;

import com.alibaba.fastjson.JSONArray;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * ShopGoods.java
 * http://www.wmeimob.com
 * Copyright © 2018 wmeimob All Rights Reserved,version 1.0
 *
 * @author：wjt Fri Aug 28 00:08:28 CST 2020 Created
 */

@Table(name = "`shop_goods`")
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class ShopGoods implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * Id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**
     * 商品类型(SHOP:商城商品 INTEGRAL:积分商城)
     */
    @Column(name = "type")
    private String type;
    /**
     * 商品名称
     */
    @Column(name = "name")
    private String name;
    /**
     * 商品分类Id
     */
    @Column(name = "classify_id")
    private Integer classifyId;
    /**
     * 规格
     */
    @Column(name = "specification")
    private String specification;
    /**
     * 商品描述
     */
    @Column(name = "goods_describe")
    private String goodsDescribe;
    /**
     * 单位
     */
    @Column(name = "unit")
    private String unit;
    /**
     * 商品图片
     */
    @Column(name = "goods_imgs")
    private JSONArray goodsImgs;
    /**
     * 价格
     */
    @Column(name = "price")
    private BigDecimal price;
    /**
     * pv值
     */
    @Column(name = "pv")
    private BigDecimal pv;
    /**
     * 销售数量
     */
    @Column(name = "sale_num")
    private Integer saleNum;
    /**
     * 库存量
     */
    @Column(name = "stock")
    private Integer stock;
    /**
     * 排序值
     */
    @Column(name = "sort")
    private Integer sort;
    /**
     * 详情文本(商品介绍)
     */
    @Column(name = "rich_id")
    private Integer richId;
    /**
     * 是否上架 0否 1是
     */
    @Column(name = "is_grounding")
    private Boolean grounding;
    /**
     * 是否热门商品
     */
    @Column(name = "is_hot")
    private Boolean hot;
    /**
     * 是否删除 0未删除 1删除
     */
    @Column(name = "is_del")
    private Boolean del;
    /**
     * 积分比例
     */
    @Column(name = "proportion")
    private Boolean proportion;
    /**
     * GmtCreate
     */
    @Column(name = "gmt_create")
    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;
    /**
     * GmtModified
     */
    @Column(name = "gmt_modified")
    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtModified;
    @Transient
    private String richTextValue;
    @Transient
    private List<Integer> idList;
}